home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 4
/
Eagles_Nest_Mac_Collection_Disc_4.TOAST
/
Desktop Publishing
/
PersPress201
/
PP Pouch
/
AutoCreate
/
Brochures
/
Brochures
< prev
next >
Wrap
Text File
|
1992-05-29
|
19KB
|
826 lines
on AutoCreate
Global FolderBase
global TheCurrentDialog, theDialog
global The_Style -- Current page style selections.
global StyleKind
global userMeasurements
set lockscreen to true
set mouseCursor to busy
set lockcursor to true
put measurements into userMeasurements
put 501 into theCurrentDialog
put ":autocreate:brochures:" into FolderBase
open util script FolderBase&"_Utility"
locatefonts
progressdialog open
repeat forever
do "put RunDialog" & TheCurrentDialog & "() into theResult"
switch theResult
case "Next"
put theCurrentDialog +1 into theCurrentDialog
exit switch
case "Prev"
case "Previous"
put theCurrentDialog -1 into theCurrentDialog
exit switch
case "Done"
Exit repeat
exit switch
case "Cancel"
get dialog(dispose, theDialog)
set measurements to userMeasurements
exit AutoCreate
exit switch
end switch
end repeat
-- Build the Pages
Set mousecursor to busy
-- Choose the Page Styles from the PICT ID's
put the_Style into StyleKind
switch The_Style
case "Modern4" -- Brochure Modern 4pg
Set mousecursor to busy
progressdialog show "Making Page Settings…"
callscript "_setpagesettings4pg", "SetPageSettings"
Set mousecursor to busy
set currentpage to 1
progressdialog show "Making Page 1…"
callscript "_Brochure 4pg Modern.pg1", "build_Modern_4pg_pg_1"
Set mousecursor to busy
set currentpage to 2
progressdialog show "Making Page 2…"
callscript "_Brochure 4pg Modern.pg2", "build_Modern_4pg_pg_2"
Set mousecursor to busy
set currentpage to 3
progressdialog show "Making Page 3…"
callscript "_Brochure 4pg Modern.pg3", "build_Modern_4pg_pg_3"
Set mousecursor to busy
set currentpage to 4
progressdialog show "Making Page 4…"
callscript "_Brochure 4pg Modern.pg4" ,"build_Modern_4pg_pg_4"
exit switch
case "Modern6" -- Brouchure Modern 6pg
progressdialog show "Making Page Settings…"
callscript "_setpagesettings6pg", "SetPageSettings"
Set mousecursor to roll
set currentpage to 1
progressdialog show "Making Pages 1 to 3…"
callscript "_Brochure 6pg Modern.pg1", "build_Modern_6pg_pg_1"
Set mousecursor to busy
set currentpage to 2
progressdialog show "Making Pages 4 to 6…"
callscript "_Brochure 6pg Modern.pg2", "build_Modern_6pg_pg_2"
Set mousecursor to busy
exit switch
case "Traditional6" -- Brochure Traditional 6pg
progressdialog show "Making Page Settings…"
callscript "_setpagesettings6pgT", "SetPageSettings"
Set mousecursor to busy
set currentpage to 1
progressdialog show "Making Pages 1 to 3…"
callscript "_Brochure 6pg Traditional.pg1", "build_Traditional_6pg_pg_1"
Set mousecursor to busy
set currentpage to 2
progressdialog show "Making Pages 4 to 6…"
callscript "_Brochure 6pg Traditional.pg2", "build_Traditional_6pg_pg_2"
Set mousecursor to busy
exit switch
end switch
if theResult = "Done" then
get dialog(dispose, theDialog)
set lockCursor to true
end if
progressdialog close
set saveglobals to true
set measurements to userMeasurements
end AutoCreate
on cleanup
Global TheCurrentDialog
global FolderBase
global StyleKind
global userMeasurements
global vHelvetica, vTimes
set measurements to points
put 502 into TheCurrentDialog
set ShuffleTextObjects to false
set lockscreen to true
set lockcursor to true
open util script FolderBase&"_Utility"
progressdialog open
set currentpage to 1
Select all text in story "Brochure Text"
progressdialog show "Copyfitting…"
set styleRecomposition to false
if StyleKind contains "Modern" then
set textfont to vHelvetica
else
set textfont to vTimes
end if
set styleRecomposition to true
copyfit
progressdialog show "Copying Logos…"
callscript "_copyLogos", "copyLogos"
progressdialog hide
repeat forever
do "put RunDialog" & TheCurrentDialog & "() into theResult"
switch theResult
case "Next"
put theCurrentDialog +1 into theCurrentDialog
exit switch
case "Prev"
case "Previous"
put theCurrentDialog -1 into theCurrentDialog
exit switch
case "Done"
Exit repeat
exit switch
case "Cancel"
get dialog(dispose, theDialog)
set measurements to userMeasurements
exit Cleanup
exit switch
end switch
end repeat
publicationsetup columns 1
set view to sizetofit
progressdialog close
if styleKind ≠ "Modern4" then
answer "Please choose Landscape Orientation…" with "OK"
domenu "Page Setup…"
end if
if styleKind = "Modern4" then
set currentpage to 4
select all text in story "Address"
copyfit
put false into killNote --init variable for use below
select objects where name of this object = "Map"
get SelectedObjects()
if number of items in it > 0 then
put the name of object (item 1 of it) into theMapObject
if kind of object theMapObject ≠ "Rectangle" then
put true into killNote
end if
select empty
select objects where name of this object = "Title Map Area"
get SelectedObjects()
if number of items in it > 0 then
set locked of object (item 1 of it) to false
if killNote = true then
clear
end if
end if
end if
end if
set measurements to userMeasurements
repeat with i = 1 to number of pages -- unlock all objects in doc so user has control
set currentpage to i
select all objects
set locked to false
end repeat
set currentpage to 1
select empty
end cleanup
function RunDialog501
-- Phase I, initial options.
Global The_Style -- Scripted Pages to use.
Global theDialog
put dialog(preload, 501) into theDialog
set lockCursor to true
set mousecursor to busy
-- Set default options
SetDialogItem 21,"Set" -- Modern 4 page
SetDialogItem 22,"Clear" -- Modern 6 Panel
SetDialogItem 23,"Clear" -- Traditional 6 Panel
-- Define action procs
SetDialogItem 24, Box -- Style Box
SetDialogItem 17, box -- Page Navigator
SetDialogITem 15, disabled
setDialogitem 10,graybox -- Preview
put 1201 into minpage
put 1204 into maxpage
put 1201 into page_one
put 1202 into page_two
put "Modern4" into The_Style
SetDialogITem 3, invisible
SetDialogITem 4, invisible
repeat forever
if The_Style = "Modern4" then
SetDialogItem 11, Picture, PAGE_ONE, visible
SetDialogItem 19, Picture, PAGE_TWO, visible
SetDialogItem 20, invisible
else
SetDialogItem 11, invisible
SetDialogItem 19, invisible
SetDialogItem 20, Picture, PAGE_ONE, visible
end if
Switch dialog(display, theDialog)
set lockCursor to true
set mousecursor to busy
-- Done Button.
case 1
put "Done" into theResult
exit repeat
exit switch
-- Cancel button
case 2
put "Cancel" into theResult
exit repeat
exit switch
-- Help
case 5
helpdialog 501, "Autocreate - Design Options"
exit switch
case 21 -- Modern 4 page
setDialogitem 10,graybox -- Preview
put "Modern4" into The_Style
put 1201 into minpage
put 1204 into maxpage
put 1201 into PAGE_ONE
put 1202 into PAGE_TWO
SetDialogItem 15, Disabled -- Prev Page
SetDialogItem 16, Enabled -- Next Page
exit switch
case 22 -- Modern 6 Panel
setDialogitem 10,graybox -- Preview
put "Modern6" into The_Style
put 1101 into minpage
put 1102 into maxpage
put 1101 into PAGE_One
put 1101 into PAGE_Two
SetDialogItem 15, Disabled -- Prev Page
SetDialogItem 16, Enabled -- Next Page
exit switch
case 23 -- Traditional 6 Panel
setDialogitem 10,graybox -- Preview
put "Traditional6" into The_Style
put 1001 into minpage
put 1002 into maxpage
put 1001 into PAGE_One
put 1001 into PAGE_Two
SetDialogItem 15, Disabled -- Prev Page
SetDialogItem 16, Enabled -- Next Page
exit switch
case 15 -- Prev page button
SetDialogItem 16, "Enabled" -- Next Page
subtract 1 from Page_One
subtract 1 from Page_Two
if Page_One = minpage then
SetDialogItem 15, "Disabled" -- Prev Page
end if
exit switch
case 16 -- Next page button
SetDialogItem 15, "Enabled" -- Prev Page
add 1 to Page_One
add 1 to Page_Two
if Page_Two = maxpage then
SetDialogItem 16, "Disabled" -- Next Page
end if
exit switch
end switch
end repeat
return theResult
end RunDialog501
function RunDialog502
-- Phase III, initial options.
Global theDialog
Global TheItems
global TheAddressData
global FolderBase
Global theBusinessFolder
put ":autocreate:brochures:" into theBusinessFolder
put dialog(preload, 502) into theDialog
set lockCursor to true
set mousecursor to busy
SetDialogItem 21, "Box" -- Box
-- Set default options
SetDialogItem 9,"Set" -- Name
SetDialogItem 11,"Set" -- Company Name
SetDialogItem 13,"Set" -- Address 1
SetDialogItem 15,"Clear" -- Address 2
SetDialogItem 17,"Clear" -- Address 3
SetDialogItem 19,"Set" -- City, State, Zip
SetDialogItem 10,"Set" -- Phone Number (+Extension)
SetDialogItem 12,"Clear" -- Fax Number
SetDialogItem 14,"Clear" -- Telex Number
SetDialogItem 16,"Clear" -- Position at Company
SetDialogItem 18,"Clear" -- Other 1
SetDialogItem 20,"Clear" -- Other 2
put theBusinessFolder&"_The Default Address" into addressfile
if not exists( file addressfile) then
SetDialogItem 23, "Disabled"
put empty into TheAddressData
set itemdel to numtochar(1)
put x into item 13 of TheAddressData -- forces 13 items
set itemdel to ","
end if
repeat forever
Switch dialog(display, theDialog)
set lockCursor to true
set mousecursor to busy
case 1 -- Next Button.
put "Next" into theResult
put 0 into itemcount
set itemdel to numtochar(1)
if Hilited(item9) then
get item 1 of TheAddressData
if it ≠ empty then put it into item 1 of TheAddressData
else put "Enter Your Name Here" into item 1 of TheAddressData
add 1 to itemcount
else put empty into item 1 of TheAddressData
if Hilited(item11) then
get item 2 of TheAddressData
if it ≠ empty then put it into item 2 of TheAddressData
else put "Enter Your Company Here" into item 2 of TheAddressData
add 1 to itemcount
else put empty into item 2 of TheAddressData
if Hilited(item13) then
get item 3 of TheAddressData
if it ≠ empty then put it into item 3 of TheAddressData
else put "123 Your Street" into item 3 of TheAddressData
add 1 to itemcount
else put empty into item 3 of TheAddressData
if Hilited(item15) then
get item 4 of TheAddressData
if it ≠ empty then put it into item 4 of TheAddressData
else put "Apartment or Suite" into item 4 of TheAddressData
add 1 to itemcount
else put empty into item 4 of TheAddressData
if Hilited(item17) then
get item 5 of TheAddressData
if it ≠ empty then put it into item 5 of TheAddressData
else put "Mail Stop" into item 5 of TheAddressData
add 1 to itemcount
else put empty into item 5 of TheAddressData
if Hilited(item19) then
get item 6 of TheAddressData
if it ≠ empty then put it into item 6 of TheAddressData
else put "City, State, Zip" into item 6 of TheAddressData
add 1 to itemcount
else put empty into item 6 of TheAddressData
if Hilited(item10) then
get item 7 of TheAddressData
if it ≠ empty then put it into item 7 of TheAddressData
else put "(123) 456-7890" into item 7 of TheAddressData
add 1 to itemcount
else put empty into item 7 of TheAddressData
if Hilited(item12) then
get item 8 of TheAddressData
if it ≠ empty then put it into item 8 of TheAddressData
else put "(123) 456-7890" into item 8 of TheAddressData
add 1 to itemcount
else put empty into item 8 of TheAddressData
if Hilited(item14) then
get item 9 of TheAddressData
if it ≠ empty then put it into item 9 of TheAddressData
else put "456-789" into item 9 of TheAddressData
add 1 to itemcount
else put empty into item 9 of TheAddressData
if Hilited(item16) then
get item 10 of TheAddressData
if it ≠ empty then put it into item 10 of TheAddressData
else put "Enter Your Position Here" into item 10 of TheAddressData
add 1 to itemcount
else put empty into item 10 of TheAddressData
if Hilited(item18) then
get item 11 of TheAddressData
if it ≠ empty then put it into item 11 of TheAddressData
else put "Enter Other data here" into item 11 of TheAddressData
add 1 to itemcount
else put empty into item 11 of TheAddressData
if Hilited(item20) then
get item 12 of TheAddressData
if it ≠ empty then put it into item 12 of TheAddressData
else put "Enter Other data here" into item 12 of TheAddressData
add 1 to itemcount
else put empty into item 12 of TheAddressData
set itemdel to ","
if itemcount > 8 then
answer "You have selected too many items."
get dialog(view, theDialog)
else exit repeat
exit switch
case 2 -- Defaults button
SetDialogItem 9,"Set" -- Name
SetDialogItem 11,"Set" -- Company Name
SetDialogItem 13,"Set" -- Address 1
SetDialogItem 15,"Clear" -- Address 2
SetDialogItem 17,"Clear" -- Address 3
SetDialogItem 19,"Set" -- City, State, Zip
SetDialogItem 10,"Set" -- Phone Number (+Extension)
SetDialogItem 12,"Clear" -- Fax Number
SetDialogItem 14,"Clear" -- Telex Number
SetDialogItem 16,"Clear" -- Position at Company
SetDialogItem 18,"Clear" -- Other 1
SetDialogItem 20,"Clear" -- Other 2
put empty into theAddressData
exit switch
-- Help
case 3
helpdialog 502, "Autocreate - Field Options"
exit switch
case 23 -- Use Saved
open file addressfile
read from file addressfile for 2000
put it into TheAddressData
close file addressfile
put "Next" into theResult
exit repeat
exit switch
end switch
end repeat
get dialog(dispose, theDialog)
set lockCursor to true
return theResult
end RunDialog502
function RunDialog503
-- Phase III, Address Text Entry.
Global theDialog
Global TheItems
global TheAddressData
Global TheBusinessFolder
global FolderBase
Global StyleKind
-- Force to go to "address" story page.
select all text in story "address"
clear
choose maintool
set displayGuides to false
put false into DoUpdate
put "unknown" into TheResult
put dialog(preload, 503) into theDialog
set lockCursor to true
set mousecursor to busy
SetDialogItem 26, "Box" -- Box
SetDialogItem 7, graybox
SetDialogItem 9, "Proxy", "contents", "1,p" -- Preview
-- Set Users options
SetDialogItem 11, "set"
repeat with x = 0 to 7
SetDialogItem 10 + x*2, Invisible
SetDialogItem 11 + x*2, Invisible
end repeat
set itemdel to numtochar(1)
put 0 into position
repeat with x = 1 to 12
get item x of theAddressData
if it ≠ empty then
SetDialogItem 11 + position*2 ,"Contents", it
SetDialogItem 11 + position*2 ,"visible"
switch x
case 1
put "Name" into title
exit switch
case 2
put "Company Name" into title
exit switch
case 3
put "Address 1" into title
exit switch
case 4
put "Address 2" into title
exit switch
case 5
put "Address 3" into title
exit switch
case 6
put "City&State" into title
exit switch
case 7
put "Phone" into title
exit switch
case 8
put "Fax" into title
exit switch
case 9
put "Telex" into title
exit switch
case 10
put "Position" into title
exit switch
case 11
put "Other 1" into title
exit switch
case 12
put "Other 2" into title
exit switch
end switch
SetDialogItem 10 + position*2, "Contents", title
SetDialogItem 10 + position*2 ,"visible"
add 1 to position
end if
end repeat
set itemdel to ","
SetDialogItem 1, contents, "Next"
put empty into theResult
repeat until theResult = "Next" or theResult = "Prev"
put dialog(display, theDialog) into itemhit
set lockCursor to true
set mousecursor to busy
Switch itemhit
case 1 -- Next Button.
put "Next" into theResult
put True into DoUpdate
exit switch
case 2 -- Update button
put true into DoUpdate
exit switch
-- Help
case 3
helpdialog 503, "Autocreate - Data Options"
exit switch
case 29 -- Previous Button
put "Prev" into TheResult
exit switch
case 28 -- Save current address
set itemdel to numtochar(1)
put 0 into position
repeat with x = 1 to 12 -- get new data
if item x of theAddressData ≠ empty then
put contentsof(value("item"& position*2 + 11)) into item x of theAddressData
add 1 to position
end if
end repeat
set itemdel to ","
if diskspace() > 500 then
put theBusinessFolder&"_The Default Address" into addressfile
open file addressfile
write theAddressData to file addressfile
close file addressfile
else
answer "Not enough disk space to save address." with "Sorry!"
end if
exit switch
end switch
if DoUpdate then
set itemdel to numtochar(1)
put 0 into position
repeat with x = 1 to 12 -- get new data
if item x of theAddressData ≠ empty then
put contentsof(value("item"& position*2 + 11)) into item x of theAddressData
add 1 to position
end if
end repeat
set itemdel to ","
select all text in story "address"
clear
put empty into TheText
switch stylekind
case "Modern6"
case "Modern4"
open script FolderBase&"_SetModernStyle"
SetModernStyle
close script FolderBase&"_SetModernStyle"
exit switch
case "traditional6"
open script FolderBase&"_SetCorporateStyle"
SetCorporateStyle
close script FolderBase&"_SetCorporateStyle"
exit switch
end switch
choose maintool
SetDialogItem 9, "Proxy", "contents", "1,p" -- Preview
put false into DoUpdate
end if
end repeat
return theResult
end RunDialog503
function RunDialog504
-- Phase III, Enter Fields
Global theDialog
Global TheItems
Global TheAddressData
Global vHelvetica, vTimes
Global StyleKind
put dialog(preload, 504) into theDialog
set lockCursor to true
set mousecursor to busy
-- No Selling Points on Traditional6
if StyleKind = "Traditional6" then
setDialogItem 12, Invisible
SetDialogItem 13, Invisible
end if
-- Set Divider box
SetDialogItem 14, box
-- Instructions
SetDialogItem 5, "Text", "Please edit the text options for your brochure."
repeat forever
Switch dialog(display, theDialog)
set lockCursor to true
set mousecursor to busy
-- Done Button.
case 15
put "Next" into theResult
exit repeat
exit switch
-- Help
case 2
helpdialog 504, "Autocreate - Design Options"
exit switch
case 44
put "Prev" into theResult
exit repeat
exit switch
end switch
end repeat
if exists( story "Brochure Title" ) then
put contentsOf(item7) into story "Brochure Title"
select all text in story "Brochure Title"
set textfont to vHelvetica
set textFace to plain
set textFace to italic
set flexibleLeading to false
set flexibleParaSpace to false
copyfit
end if
progressdialog show "Scanning For Taglines…"
-- Find the TagLines
repeat with x = 1 to number of pages
Set Currentpage to x
select empty
select objects where name of this object contains "Tag Line"
put SelectedObjects() into TheObjects
if TheObjects ≠ empty then
repeat with o = 1 to number of items in TheObjects
put item 1 of storyloc of object (item o of theObjects) into TheStory
put contentsOf(item9) into story theStory -- Make sure to find all tag lines.
select all text in story theStory
set textFace to plain
if StyleKind contains "Modern" then
set textfont to vHelvetica
set textFace to bold,italic
else
set textFace to bold
set textfont to vTimes
end if
set flexibleLeading to false
set flexibleParaSpace to false
copyfit
end repeat
end if
end repeat
if exists( story "Selling Points") then
put contentsOf(item13) into story "Selling Points"
select all text in story "Selling Points"
set textfont to vHelvetica
set textFace to plain
set textFace to italic
set flexibleLeading to false
set flexibleParaSpace to false
copyfit
end if
return theResult
end RunDialog504
function RunDialog505
Global TheScriptFolder
progressdialog show "Scanning For Pullquotes…"
callscript "_MakePullQuotesGeneral", "MakePullQuotes"
progressdialog hide
return "next"
end RunDialog505
function RunDialog506
Global TheScriptFolder
progressdialog show "Scanning For Captions…"
callscript "_MakeCaptionsGeneral", "MakeCaptions"
progressdialog hide
return "done"
end RunDialog506
on autocreatehelp
helpdialog 500, "Autocreate - Template Options"
set saveglobals to true
end autocreatehelp
on callscript file, message
global FolderBase
open script FolderBase&file
do message
close script FolderBase&file
end callscript